local t = Def.ActorFrame {};
local scoretype = ThemePrefs.Get("ScoreType");

for player in ivalues(GAMESTATE:GetHumanPlayers()) do
	t[#t+1] = Def.ActorFrame{
		InitCommand=function(self)
			self:y(SCREEN_TOP+51);
			self:x(player == PLAYER_1 and SCREEN_CENTER_X-62 or SCREEN_CENTER_X+309);
		end;
		Def.RollingNumbers{
			File = THEME:GetPathF("Common", "normal");
			InitCommand = function(self)
				self:x(player == PLAYER_1 and -204 or 100);
			end;
			ScoreChangedMessageCommand=function(self, params)
				self:Load("RollingNumbersScoring");
				self:targetnumber(STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetScore());
			end;
			Condition=scoretype == "Score";
		};
		Def.RollingNumbers{
			File = THEME:GetPathF("Common", "normal");
			InitCommand = function(self)
				self:x(player == PLAYER_1 and -204 or 100);
			end;
			ScoreChangedMessageCommand=function(self, params)
				local Marvelous = string.format("% 5d",STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetTapNoteScores("TapNoteScore_W1"));
				local Perfect = string.format("% 5d",STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetTapNoteScores("TapNoteScore_W2"));
				local Great = string.format("% 5d",STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetTapNoteScores("TapNoteScore_W3"));
				local Ok = string.format("% 5d",STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetHoldNoteScores("HoldNoteScore_Held"));
				local EXScore = (Marvelous * 3) + (Perfect * 2) + Great + (Ok * 3);
				self:Load("RollingNumbersEXScoring");
				self:targetnumber(EXScore);
			end;
			Condition=scoretype == "EXScore";
		};
		LoadFont("Common normal")..{
			Text="100%";
			InitCommand = function(self)
				self:x(player == PLAYER_1 and -204 or 100);
			end;
			ScoreChangedMessageCommand=function(self,params)
				self:settext(FormatPercentScore(STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetPercentDancePoints()))
			end;
			Condition=scoretype == "Percent";
		};
		LoadFont("Common normal")..{
			InitCommand=function(self)
				self:horizalign(right);
				local song = GAMESTATE:GetCurrentSong();
				local steps = GAMESTATE:GetCurrentSteps(player);
				local level = "";
				local diffLabel = CustomDifficultyToLocalizedString(GAMESTATE:GetCurrentSteps(player):GetDifficulty());
				if song and steps ~= nil then
					level = steps:GetMeter();
				end
				self:settext(diffLabel.." - "..level);
				self:x(0);
			end;
		};	
	};
end

return t;